package com.hankol.newretail.adapter

import android.widget.ImageView
import android.widget.TextView
import com.baselibrary.extension.checkValue
import com.baselibrary.extension.setMallPriceTTF
import com.baselibrary.utils.AmountUtil
import com.baselibrary.utils.GlideUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.newretail.R
import com.hankol.newretail.bean.NewManEnjoySpuBean

/*新人专享 */
class MallNewEnjoyAdapter : BaseQuickAdapter<NewManEnjoySpuBean, BaseViewHolder>(R.layout.item_new_enjoy) {

    override fun convert(helper: BaseViewHolder, item: NewManEnjoySpuBean) {
        GlideUtils.loadImg_101(mContext, item.icon.checkValue(), helper.getView<ImageView>(R.id.img_cover))
        helper.getView<TextView>(R.id.tv_price).setMallPriceTTF(mContext)
        helper.setText(R.id.tv_price, "${AmountUtil.changeF2Y("${item.showPrice}")}")
    }
}